package com.suvel.study.controller;

import com.suvel.study.service.EmailService;
import com.suvel.study.vo.ResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/email")
public class EmailController {
    
   
    
    @Autowired
    private EmailService emailService;

    @GetMapping("/{email}/{code}")
    public Boolean sendEmailCode(@PathVariable String email,@PathVariable String code){
        boolean result = true;
        try {
            emailService.sendEmailCode(email, code);
        }catch (Exception ex) {
            ex.printStackTrace();
            result = false;
        }
        return result;
    }
    
}
